<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateChargesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('charges', function (Blueprint $table) {
            $table->bigIncrements('id');                    //充值（消费）id
            $table->bigInteger('customer_id');              //客户id
            $table->bigInteger('change_before');            //充值（消费）前的余额
            $table->bigInteger('change_after');             //充值（消费）后的余额
            $table->string('change_type', 100);             //类型
            $table->string('change_params')->nullable();    //充值（消费）参数
            $table->string('remark');                       //备注
            $table->timestamp('created_at');                //创建时间
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('charges');
    }
}
